<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>添加学生 - 学生信息管理系统</title>
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <link rel="stylesheet " type="text/css " href="css/globle.css " />
  <link href="js/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link rel="stylesheet " type="text/css " href="css/style.css " />
  <script src='js/jquery-2.0.3.js'></script>
  <script src="js/bootstrap/js/bootstrap.js"></script>
  <script src='js/index.js'></script>
  <script src="scripts/index.js"></script>
</head>

<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a href="#" class="navbar-brand">学生信息管理系统</a>
    </div>
    <div id="navbar" class="collapse navbar-collapse">
      <ul class="nav navbar-nav">
        <li><a href="#">首页</a></li>
        <li class="active"><a href="#">学生管理</a></li>
      </ul>
    </div>
  </div>
</nav>
<header>
  <div class="container">
    <h1>学生查询及管理</h1>
  </div>
</header>
<div class="container toolbar">
  <button class="btn btn-success" onclick="location.href='/add'">添加学生</button>
  <button class="btn btn-warning" data-toggle="modal" data-target="#searchModal">
    <span class="glyphicon glyphicon-search"></span> 搜索
  </button>
</div>
<div class="container data">
  <div class="table-responsive">
    <table class="table table-bordered table-hover">
      <tbody>
        <tr>
          <th>姓名</th>
          <th class="text-center">性别</th>
          <th class="text-center">年龄</th>
          <th class="text-center">手机号</th>
          <th>电子邮箱</th>
          <th class="text-center">修改</th>
          <th class="text-center">删除</th>
        </tr>
        <tr>
          <td>尹学江</td>
          <td class="text-center">男</td>
          <td class="text-center">20</td>
          <td class="text-center">15738361415</td>
          <td>378915051@qq.com</td>
          <td class="text-center">
            <span class="glyphicon glyphicon-edit" onclick="location.href='/edit/5808d35cbc79121c07974a10'"></span>
          </td>
          <td class="text-center">
            <span class="glyphicon glyphicon-trash" onclick="removeStudent('5808d35cbc79121c07974a10', '尹学江')"></span>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
  <nav>
    <ul class="pagination">
      <li class="disabled">
        <a onclick="showPage(0, 1)">上一页</a>
      </li>
      <li class="active">
        <a onclick="showPage(1, 1)">1</a>
      </li>
      <li class="disabled">
        <a onclick="showPage(2, 1)">下一页</a>
      </li>
    </ul>
  </nav>
</div>
<script type="text/html" id="table-template">
  <div class="table-responsive">
    <table class="table table-bordered table-hover">
      <tr>
        <th>姓名</th>
        <th class="text-center">性别</th>
        <th class="text-center">年龄</th>
        <th class="text-center">手机号</th>
        <th>电子邮箱</th>
        <th class="text-center">修改</th>
        <th class="text-center">删除</th>
      </tr>
      {{each students as s i}}
      <tr>
        <td>{{s.name}}</td>
        <td class="text-center">{{s.isMale ? '男': '女'}}</td>
        <td class="text-center">{{s.age}}</td>
        <td class="text-center">{{s.phone}}</td>
        <td>{{s.email}}</td>
        <td class="text-center">
          <span class="glyphicon glyphicon-edit" onclick="location.href='/edit/{{s.id}}'"></span>
        </td>
        <td class="text-center">
          <span class="glyphicon glyphicon-trash" onclick="removeStudent('{{s.id}}', '{{s.name}}')"></span>
        </td>
      </tr>
      {{/each}}
    </table>
  </div>
  <nav>
    <ul class="pagination">
      <li class="{{page <= 1 ? 'disabled' : ''}}">
        <a onclick="showPage({{page-1}}, {{pageCount}})">上一页</a>
      </li>
      {{each pages as p i}}
      <li class="{{page == p ? 'active' : ''}}">
        <a onclick="showPage({{p}}, {{pageCount}})">{{p}}</a>
      </li>
      {{/each}}
      <li class="{{page >= pageCount ? 'disabled' : ''}}">
        <a onclick="showPage({{page+1}}, {{pageCount}})">下一页</a>
      </li>
    </ul>
  </nav>
</script>
<a class="btn btn-primary" data-toggle="modal" href='#modal-id'>Trigger modal</a>
<div class="modal fade" id="modal-id">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Modal title</h4>
      </div>
      <div class="modal-body">
        111111111111
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>
<!-- 删除确认模态框 -->
<div class="modal fade" id="removeModal" tabindex="-1" role="dialog">
  <div class="modal-dialog modal-sm" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
        <h4 class="modal-title">确认要删除吗？</h4>
      </div>
      <div class="modal-body"></div>
      <div class="modal-footer">
        <button type="button" class="btn btn-danger">　确定　</button>
        <button type="button" class="btn btn-default" data-dismiss="modal">　取消　</button>
      </div>
    </div>
  </div>
</div>
<!-- 搜索模态框 -->
<div class="modal fade" id="searchModal" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span>×</span></button>
        <h4 class="modal-title">学生信息搜索</h4>
      </div>
      <div class="modal-body">
        <form class="form-horizontal">
          <div class="form-group">
            <label for="name" class="col-sm-3 control-label">姓名：</label>
            <div class="col-sm-4">
              <input id="name" name="name" class="form-control" placeholder="学生姓名" type="text">
            </div>
          </div>
          <div class="form-group">
            <label for="none" class="col-sm-3 control-label">性别：</label>
            <div class="col-sm-4">
              <label class="radio-inline">
                <input name="isMale" id="none" value="" checked="" type="radio"> 不限
              </label>
              <label class="radio-inline">
                <input name="isMale" id="male" value="true" type="radio"> 男
              </label>
              <label class="radio-inline">
                <input name="isMale" id="female" value="false" type="radio"> 女
              </label>
            </div>
          </div>
          <div class="form-group">
            <label for="phone" class="col-sm-3 control-label">手机：</label>
            <div class="col-sm-4">
              <input id="phone" name="phone" class="form-control" placeholder="手机号" type="text">
            </div>
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">　关闭　</button>
        <button onclick="showPage(1,1)" type="button" class="btn btn-success" data-dismiss="modal">　搜索　</button>
      </div>
    </div>
  </div>
</div>
</body>

</html>
